/*****************************************************************************
* Keppe Messenger (KMP) Keppe Project-Team User Messaging System
* Copyright (C) 2013-2014 Keppe Project-Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/

#ifndef KMSGFW10_H
#define KMSGFW10_H
#include <QSslError>
#include <QSslSocket>
#include "KMsgFw_shared.h"

class KMSGFWSHARED_EXPORT KMsgFw10 : public QObject
{
    Q_OBJECT
    
public:
    KMsgFw10(QObject *parent = 0);
    int loginUser(const char* username, const char* password);
    int logoutUser();
    bool isLoggedIn();
    const char* getMessengerStandardAvatar();
    const char* getUserContacts();
    const char* getUserContactsLength();
    const char* getUserContactsRequests();
    const char* getUserContactsWithStates();
    const char* getUserFriendRequests();
    const char* getUserFriendRequestsLength();
    int addUserContact(const char* username);
    int delUserContact(const char* username);
    int removeUserContact(const char* username);
    int getAnotherUserOnlineState(const char* username);
    int getUserOnlineState();
    int setUserOnlineState(int state);
    const char* getAnotherUserMessageState(const char* username);
    const char* getUserMessageState();
    int setUserMessageState(const char* message);
    const char* getAnotherUserAvatar(const char* username);
    const char* getUserAvatar();
    int setUserAvatar(const char* base64, const char* format);
    const char* getAnotherUserNick(const char* username);
    const char* getUserNick();
    int setUserNick(const char* nick);
    const char* getAnotherUserMail(const char* username);
    const char* getUserMail();
    int setUserMail(const char* mail, bool vfo);
    int setUserPassword(const char* oldpassword, const char* newpassword);
    int sendPokeToUser(const char* username);
    int sendMessageToUser(const char* username, const char* message);
    bool isObjectIncoming();
    const char* readObject();
    QString getClassVersion();

private:
    QList<QSslError> sslErrors;
    QSslSocket *tcpSocket;
    bool loggedIn;
};

#endif // KMSGFW10_H
